package edu.mit.media.fv.aqview
{
	import edu.mit.media.fv.components.AQCircleButton2;
	import edu.mit.media.fv.components.AQTextArea;
	import edu.mit.media.fv.components.AQTextField;
	import edu.mit.media.fv.aqwidgets.*;
	
	import flash.display.MovieClip;
	import edu.mit.media.fv.blocks.*;
	import edu.mit.media.fv.components.*;
	import edu.mit.media.fv.events.*;
	import edu.mit.media.fv.fluidspace.*;
	
	import flash.display.*;
	import flash.events.*;
	import flash.text.*;
	
	public class AQTextViewer extends AQViewer
	{
		var _tags:AQTextField;
		var _sender:AQTextField;
		var _date:AQTextField;
		var _textbox:AQTextArea;
		var _sendButton:DisplayObject;
		var _goodButton:DisplayObject;
		var _badButton:DisplayObject;
		
		public function AQTextViewer()
		{
			super();
			FluidEventHandler.addEventListener(DisplayEvent.OPEN_TEXT, displayWidget);
		}
		private function replyMessage(event:MouseEvent):void{
			var e:WidgetEvent = new WidgetEvent(WidgetEvent.DISPLAY_TEXT_BUILDER);
			e.subject = this._tags.text;
			e.id = this.id;
			e.text = this._textbox.text;
			FluidEventHandler.dispatchEvent(e);
		}
		
		public function displayWidget(event:DisplayEvent):void{
			FluidEventHandler.dispatchEvent(new WidgetEvent(WidgetEvent.DISPLAY_WIDGET, this, "Text"));
			
			this._tags.text = event.subject;
			this._sender.text = event.sourceName;
			this._date.text = event.date;
			this._textbox.text = event.text;
			this.id = event.id;
		}

	}
}